<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>版心居中</title>
		<style>
			.box {
				width: 1000px;
				height: 300px;
				background-color: pink;
				/* 版心水平居中对齐 */
				/* margin-left: auto;
				margin-right: auto; */
				/*  上下   左右 */
				margin: 0 auto;
				text-align: center;
			}
		</style>
	</head>
	<body>
		<div class="box">文字</div>
	</body>
</html>